package models

import (
	"goods_srv/basic/config"
	"time"
)

type CabinetSize struct {
	Id          uint32    `gorm:"column:id;type:int UNSIGNED;primaryKey;not null;" json:"id"`
	CabinetSize string    `gorm:"column:cabinet_size;type:varchar(20);comment:柜子类型;not null;" json:"cabinet_size"` // 柜子类型
	CreatedAt   time.Time `gorm:"column:created_at;type:datetime;not null;default:CURRENT_TIMESTAMP;" json:"created_at"`
	UpdatedAt   time.Time `gorm:"column:updated_at;type:datetime;not null;default:CURRENT_TIMESTAMP;" json:"updated_at"`
	DeletedAt   time.Time `gorm:"column:deleted_at;type:datetime;default:NULL;" json:"deleted_at"`
}

func (c *CabinetSize) TableName() string {
	return "cabinet_size"
}
func (c *CabinetSize) Create() error {
	return config.DB.Create(&c).Error
}
